@extends('layouts.app')

@section('title','EditClub')

@section('content')
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <a class="create-return" href="{{ route('club.index') }}">
                    <span><i class="fa fa-chevron-circle-left fa-2x" aria-hidden="true"></i></span>
                    <span>返回</span>
                </a>

                <div class="create">
                    <div class="create-title">编辑俱乐部信息</div>
                    {!! Form::model($club, ['action' => ['ClubController@update', $club->id], 'files' => true]) !!}
                    <input name="_method" type="hidden" value="PATCH">
                    {{ csrf_field() }}
                    <div class="create-list{{ $errors->has('club_name')?'':'' }}">
                        {!! Form::label('club_name','俱乐部名称')!!}
                        {!! Form::text('club_name',$club->club_name)!!}
                        @if ($errors->has('club_name'))
                            <span class="help-block">
                                <strong>{{ $errors->first('club_name') }}</strong>
                            </span>
                        @endif
                    </div>
                    <div class="create-list{{ $errors->has('club_intro')?'':'' }}">
                        {!! Form::label('club_intro','俱乐部简介') !!}
                        <div>
                            {!! Form::textarea('club_intro',$club->club_intro) !!}
                            @if ($errors->has('club_intro'))
                                <span class="help-block">
                                    <strong>{{ $errors->first('club_intro') }}</strong>
                                </span>
                            @endif
                        </div>
                    </div>
                    <div class="create-list">
                        {!! Form::label('club_pic','俱乐部图片')!!}
                        <div>
                            {!! Form::file('club_pic') !!}
                            @if ($errors->has('club_pic'))
                                <div class="help-block">
                                    <strong>{{ $errors->first('club_pic') }}</strong>
                                </div>
                            @endif
                            <img src="/uploads/clubs_pic/clubs/{{ $club->club_pic }}" width="100px" style="margin-top: 10px;">
                        </div>
                    </div>
                    <div class="create-list{{ $errors->has('club_address')?'':'' }}">
                        {!! Form::label('club_address','地址')!!}
                        {!! Form::text('club_address',$club->club_address)!!}
                        @if ($errors->has('club_address'))
                            <span class="help-block">
                                <strong>{{ $errors->first('club_address') }}</strong>
                            </span>
                        @endif
                    </div>
                    <div class="create-list{{ $errors->has('club_phone')?'':'' }}">
                        {!! Form::label('club_phone','联系方式')!!}
                        {!! Form::text('club_phone',$club->club_phone)!!}
                        @if ($errors->has('club_phone'))
                            <span class="help-block">
                                <strong>{{ $errors->first('club_phone') }}</strong>
                            </span>
                        @endif
                    </div>
                    <div class="create-list{{ $errors->has('work_time')?'':'' }}">
                        {!! Form::label('work_time','营业时间')!!}
                        {!! Form::text('work_time',$club->work_time)!!}
                        @if ($errors->has('work_time'))
                            <span class="help-block">
                                <strong>{{ $errors->first('work_time') }}</strong>
                            </span>
                        @endif
                    </div>

                    <div class="create-btn">
                        {!! Form::submit('更新'); !!}
                    </div>

                    {!! Form::close() !!}
                    <div id="debug"></div>
                </div>
            </div>
        </div>
    </div>
@endsection